home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PRIVATE.ZIP
/
_SGETNL.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
2KB
|
80 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#if BUG68K
#ifndef NDEBUG
char *rcsid__sgetnl = "$Header: c:/curses/private/RCS/_sgetnl.c%v 2.0 1992/11/15 03:24:38 MH Rel $";
#endif
void c_setnl( char* ); /* conv nl -> CTRL-\ */
void c_getnl( char* ); /* conv CTRL-\ -> nl */
/*man-start*********************************************************************
_setnl() - BUG68K: set newline for 68000 C compiler
PDCurses Description:
This is a private PDCurses function.
This function circumvents a problem in the 68000 C library: If
the standard sprintf is used, it will ignore any newlines in
the format string. Therefore this routine changes the newlines
to CTRL-\ characters, to be restored later by the getnl()
function.
PDCurses Return Value:
This function does not return a value.
PDCurses Errors:
There are no defined errors for this routine.
Portability:
PDCurses void c_setnl( char* fmt ); /* BUG68K only */
**man-end**********************************************************************/
void _setnl(char *fmt)
{
while (*fmt)
{
if (*fmt == '\n')
*fmt = 0x1c;
fmt++;
}
}
/*----------------------------------------------------------------------
$ _getnl() - BUG68K: get newline for 68000 C compiler
$
$ PDCurses Description:
$ This is a private PDCurses function.
$
$ This function circumvents a problem in the 68000 C library: If
$ the standard sprintf is used, it will ignore any newlines in
$ the format string. Therefore this routine changes CTRL-\
$ characters (already set by setnl()) back to newlines.
$
$ PDCurses Return Value:
$ This function does not return a value.
$
$ PDCurses Errors:
$ There are no defined errors for this routine.
$
$ Portability:
$ PDCurses void c_getnl( char* fmt ); /* BUG68K only */
$
$----------------------------------------------------------------------
*/
void _getnl(fmt)
char* fmt;
{
while (*fmt)
{
if (*fmt == 0x1c)
*fmt = '\n';
}
}
#endif